]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dateMenu: Block notification banners while the calendar is open
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Feb 2015 22:53:18 +0000 (23:53 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Feb 2015 16:41:34 +0000 (17:41 +0100)
The new banner position interferes with the calendar drop-down. Resolve
this by blocking banners while the calendar is shown.

https://bugzilla.gnome.org/show_bug.cgi?id=744850

js/ui/dateMenu.js
js/ui/messageTray.js

index 7e2cb5c2adfdae7d4397f8da74dc8bd30d8c5651..55b360b3166b112032ddbe4f675840ce436b6d9e 100644 (file)
@@ -358,13 +358,15 @@ const DateMenuButton = new Lang.Class({
                                    this._messageList.setDate(date);
                                }));
 
-        // Whenever the menu is opened, select today
         this.menu.connect('open-state-changed', Lang.bind(this, function(menu, isOpen) {
+            // Whenever the menu is opened, select today
             if (isOpen) {
                 let now = new Date();
                 this._calendar.setDate(now);
                 this._date.setDate(now);
             }
+            // Block notification banners while the menu is open
+            Main.messageTray.bannerBlocked = isOpen;
         }));
 
         // Fill up the first column
index 2d1bf9f83ebfff05ea9d051cd88c8b60da0076bc..96fa917b8cff27f18a5a83ac6dfc2a8c4a7ec4ae 100644 (file)
@@ -1365,6 +1365,7 @@ const MessageTray = new Lang.Class({
             this._onStatusChanged(proxy.status);
         }));
         this._busy = false;
+        this._bannerBlocked = false;
         this._presence.connectSignal('StatusChanged', Lang.bind(this, function(proxy, senderName, [status]) {
             this._onStatusChanged(status);
         }));
@@ -1478,6 +1479,13 @@ const MessageTray = new Lang.Class({
         return this._notificationQueue.length;
     },
 
+    set bannerBlocked(v) {
+        if (this._bannerBlocked == v)
+            return;
+        this._bannerBlocked = v;
+        this._updateState();
+    },
+
     contains: function(source) {
         return this._sources.has(source);
     },
@@ -1688,6 +1696,10 @@ const MessageTray = new Lang.Class({
     // _updateState() figures out what (if anything) needs to be done
     // at the present time.
     _updateState: function() {
+        this.actor.visible = !this._bannerBlocked;
+        if (this._bannerBlocked)
+            return;
+
         // If our state changes caused _updateState to be called,
         // just exit now to prevent reentrancy issues.
         if (this._updatingState)